package com.lumyc.observer;

public class Observer2 extends Observer {
    public Observer2(Subject subject){
        this.subject = subject;
        this.subject.attach(this);
    }
    @Override
    public void update() {
        System.out.println("observer2：被观察者的状态更新了！state = "+subject.getState());
    }
}
